1. Field of the Invention
The present invention relates to a program development system, a method for developing programs and a storage medium storing programs for development of programs and more particularly to a program development system, a method for developing programs and a storage medium storing programs for development of programs to be suitably used for developing programs that can be incorporated into a real time control system such as various electronic apparatus including a facsimile, copying machine as well as a monitoring/controlling system including power facilities, which has to be controlled in real time.
2. Description of the Related Art:
A real time control system is required to carry out processing of an event which is a stimulus from the outside and inside of the system including reception of various signals, of a state which is a condition held by the system including a standby state to receive signals, of a combination of the above event and state and of a lot of actions to be executed by the system when a specific event occurs in a specified state. As one of approaches for developing programs to be incorporated into such a real time control system, a method using a State Transition Matrix is known. The State Transition Matrix is a two-dimensional matrix wherein an event or state is assigned to a string or a row and both the actions corresponding to a cell which is a point of intersection of an event and a state and the state subsequent to transition taking place after the action are arranged. Though the current real time control system has recently been made large-scale and increased in complexity, this method for developing programs allows basic design of the system by even a less experienced person, resulting in labor saving and acceleration of developing periods.
FIG. 22 is a block diagram showing an example of electrical configurations of a conventional program development system disclosed in Japanese Laid-open Patent Application No. Hei9-325952.
The program development system in this example is approximately composed of a definition matrix inputting section 1 to input information about abstract mechanical definition which defines, by using a hierachically related state transition matrix, an operation of a system including activity that means processing performed continuously during time required for processing in each state and in a current state, a storing section 2 to store the information about the inputted abstract mechanical definition as an abstract mechanical definition matrix, a state hierarchy extracting section 3 used to extract a hierarchical structure of a state from the abstract mechanical definition matrix read from the storing section 2, a forecast processing time calculating section 4 used to calculate a forecast processing time assigned to its lower state in each state in the abstract mechanical definition matrix and to judge whether or not the calculated result exceeds the forecast processing time of the state to be handled at present, and a warning display section 5 used to check the calculated result and to issue a warning if a total processing time required in the lower state exceeds that required in the upper state.
This configurations allows, prior to actual operations of a system, a verification, by using a combination of fragmentary information about processing time, that an operation is carried out without delay.
In the conventional program development system, the forecast processing time calculating section 4 is used to calculate the forecast processing time assigned to its lower state in each state in the abstract mechanical definition matrix and the warning display section 5 is employed to issue a warning if the total time required for processing in the lower state exceeds that in the upper state being handled at present.
However, the processing time is ideal time based on specifications of a real time control system and no consideration is given to a variety of actually occurring events.
Accordingly, when a program developed on the basis of such an abstract mechanical definition matrix is incorporated into a system, if a malfunction that the system is not actuated to specifications occurs, it is necessary to retrace steps to the extent that even basic design is amended, causing development periods longer. This is one disadvantage of the conventional system.
Another disadvantage of the conventional system is that, the development time is usually restricted within a limit and if such a malfunction as described above occurs at the last stage of the development, retracing steps to the extent that basic design is amended is not allowed and there would be no way but choose rough and temporizing amendments, thus degrading the quality of the system
In view of the above, it is an object of the present invention to provide a program development system, a method for developing programs and a storage medium storing programs for development of programs by which the reduction in development periods of a program to be incorporated into a real time control system and the improvement of qualities are realized.
According to a first aspect of the present invention, there is provided a program development system comprising:
a state transition matrix storing section having two or more cells designated by a state taken by a system for which a program is developed and by an event being a stimulus from the outside or inside of the system, and storing a state transition matrix describing contents of processing to be performed by the system or a state subsequent to transition;
a time information storing section to store time information corresponding to each cell in the state transition matrix; and
a simulator to obtain processing time required for a simulation of operations of the system by accumulating events inputted sequentially and time information corresponding to a cell sequentially designated by a state inputted as an initial state and by a state subsequent to transition.
In the foregoing, a preferable mode is one wherein the program development system is provided with an inputting section to detect the designation of any of indication positions each corresponding to two or more events or states constituting the state transition matrix displayed in the display section and to input the positional information about the indication positions into the simulator and wherein the simulator comprises an analysis section to convert positional information inputted by the inputting section to an event code or state code corresponding to the display section, a state storing section to store a state corresponding to the state code or a state subsequent to transition described in each cell, a time accumulating section to accumulate the time information, and a state transition judging section to store a state corresponding to the state code, as the initial state, to the state storing section and to decide a corresponding cell based on an event corresponding to the event code and a state stored in the state storing section and by referring to a state transition matrix read from the state transition matrix storing section and, after reading time information corresponding to the decided cell, to store it to the time accumulating section, and further after reading the state subsequent to transition described in the decided cell, to store it to the state storing section.
Also, a preferable mode is one wherein the program development system is provided with an event inputting section to input the initial state and a test script file describing timing of occurrence of each event described in the state transition matrix or timing in operations of constituting factors of the system to be performed to specifications to the simulator and wherein the simulator comprises an event analysis section to create an event inputting sequence obtained by re-arranging, in order of occurrence time, two or more events in a test script file inputted by the event inputting section, a state storing section to store the initial state or a state subsequent to transition described in each cell, a time accumulating section to accumulate the time information, and a state transition judging section to store the initial state into a state storing section and to judge a cell based on an event to be captured, in order of an earlier time, from the event inputting sequence and the state stored in the state storing section and by referring to a state transition matrix read from the state transition matrix storing section and, after reading time information corresponding to the decided cell from the time information storing section, to accumulate it in the time accumulating section and, after reading a state subsequent to transition described in the decided cell from the state transition matrix storing section, to store it to the state storing section.
Also, a preferable mode is one wherein the program development system has a test script file creating section to create the test script file from history data of execution of the simulation performed by the simulator based on the initial state inputted by manipulating an operation section and two or more events.
Also, a preferable mode is one wherein the simulator is provided with a time comparison section adapted to subtract accumulated time being currently stored in the time accumulating section from occurrence time of the event and, if a positive result is obtained by the subtraction, to add the subtraction result, as a differential time, which is a difference between processing time required for instructions for processing of operations of peripheral devices from a control section constituting the system and processing time required for operations of peripheral devices to be performed in accordance with the processing instructions to the accumulated time being currently stored in the time accumulating section.
Also, a preferable mode is one wherein the state transition matrix storing section stores a state transition matrix of operations of a control section constituting the system and a state transition matrix of operations of peripheral devices controlled by the control section and wherein the time information storing section stores time information about operations of the control section and time information about operations of the peripheral devices, and wherein the simulator is composed of a first simulator to accumulate time information about operations of the control section and a second simulator to accumulate time information about operations of the peripheral devices independently of the first simulator.
Also, a preferable mode is one wherein the program development system is provided with a generator to create a source program written in a programming language to be incorporated into the system based on the state transition matrix, a compiler to convert the source program to an object program written in a machine language, a first calculating section to calculate time information corresponding to each cell by multiplying an operational speed of the control section constituting the system by code numbers of a machine language constituting the object program corresponding to the processing described in each cell in the state transition matrix or to transition before and after it.
Also, a preferable mode is one wherein the program development system is provided with a generator to create a source program written in a programming language to be incorporated into the system based on the state transition matrix, a compiler to convert the source program to an object program written in a machine language, an In-Circuit emulator or a code simulator adapted to execute the object program to allow processing of almost the same as actual operations of the system, and a second calculating section to calculate time information corresponding to each cell in the state transition matrix based on execution time obtained by the execution of the object program by the In-Circuit emulator or the code simulator.
Also, a preferable mode is one wherein the time information storing section is composed of at least two out of a first time information storing section to store time information inputted by manipulating the control section corresponding to each cell in the state transition matrix, a second time information storing section to store time information calculated by the first calculating section corresponding to each cell in the state transition matrix, or a third time information storing section to store time information calculated by the second calculating section corresponding to each cell in the state transition matrix, and a comparison section adapted to the simulator to compare accumulated results obtained by accumulating the corresponding time information at the time of simulation based on time information stored in at least two out of the time information storing sections 1 to 3.
Furthermore, a preferable mode is one wherein the time information storing section or the first time information storing section stores time information as values with a certain latitude or variables in accordance with a permissible range in specifications of the system and wherein the simulator is adapted to read the maximum value, minimum value, average values or values randomly selected out of the values with a certain latitude when time information corresponding to a specified cell is read from the time information storing section or the first time information storing section or to change the time information to be accumulated in accordance with the variables.
In the foregoing, it is preferable that the test script file is in a timing chart format, text format or message sequence chart format.
Also, it is preferable that the time information is processing time required for processing described in a corresponding cell.
Also, a preferable mode is one wherein the time information consists of the processing time and overhead time required for transition from a state or a processing to another state or another processing.
Furthermore, a preferable mode is one wherein the overhead time is uniform or varies depending on each cell or each transition.
According to a second aspect of the present invention, there is provided a method for developing a program comprising:
employing a state transition matrix storing section having two or more cells designated by a state taken by a system for which a program is developed and by an event being a stimulus from the outside or inside of the system, and storing a state transition matrix describing contents of processing to be performed by the system or a state subsequent to transition;
employing a time information storing section to store time information corresponding to each cell in the state transition matrix; and
obtaining processing time required for a simulation of operations of the system by accumulating events inputted sequentially and time information corresponding to a cell sequentially designated by a state inputted as an initial state and by a state subsequent to transition.
In the above-mentioned second aspect, a preferable mode is one that wherein comprises the steps of:
employing an inputting section to detect the designation of any of indication positions each corresponding to two or more events or states constituting the state transition matrix displayed in the display section and to input the positional information about the indication positions into the simulator;
converting positional information inputted by the inputting section to an event code or state code corresponding to the display position;
storing a state corresponding the state code as the initial state to a state storing section;
deciding a cell based on an event corresponding to the event code and a state stored in the state storing section and by referring to a state transition matrix read from the state transition storing section;
reading time information corresponding to the decided cell from the time information storing section and accumulating it in the time accumulating section; and
reading a state subsequent to transition described in the decided cell from the state transition matrix storing section and of storing it to the state storing section.
Also, a preferable mode is one that wherein comprises the steps of:
employing an event inputting section to input the initial state and a test script file describing timing of occurrence of each event described in the state transition matrix or timing in operations of constituting factors of the system to be performed to specifications;
creating an event inputting sequence obtained by re-arranging, in order of occurrence time, two or more events in a test script file inputted by the event inputting section;
storing the initial state to a state storing section;
deciding a corresponding cell based on an event captured in order of an earlier time from the event inputting sequence and a state stored in the state storing section and by referring to a state transition matrix read from the state transition matrix storing section;
reading time information corresponding to the decided cell from the time information storing section and accumulating it from a time accumulating section; and
reading a state subsequent transition described in the decided cell from the state transition matrix storing section and storing it to the state storing section.
Also, a preferable mode is one that wherein comprises the step of creating the test script file from history data of execution of the simulation performed by the simulator based on the initial state inputted by manipulating an operation section and two or more events.
Also, a preferable mode is one that wherein comprises the steps of subtracting accumulated time being currently stored in the time accumulating section from occurrence time of the event and, if a positive result is obtained by the subtraction, and of adding the subtraction result, as a differential time, which is a difference between processing time required for instructions for processing of operations of peripheral devices from a control section constituting the system and processing time required for operations of peripheral devices to be performed in accordance with the processing instructions to the accumulated time being currently stored in the time accumulating section.
Also, a preferable mode is one that wherein comprises the steps of storing a state transition matrix of operations of a control section constituting the system and a state transition matrix of operations of peripheral devices controlled by the control section to the state transition matrix storing section, storing time information about operations of the control section and time information about operations of the peripheral devices to the time information storing section, accumulating time information about operations of the control section and accumulating time information about operations of the peripheral devices independently of the steps.
Also, a preferable mode is one that wherein comprises the steps of creating a source program written in a programming language to be incorporated into the system based on the state transition matrix, converting the source program to an object program written in a machine language, and calculating time information corresponding to each cell by multiplying an operational speed of the control section constituting the system by code numbers of a machine language constituting the object program corresponding to the processing described in each cell in the state transition matrix or to transition before and after it.
Also, a preferable mode is one that wherein comprises the steps of creating a source program written in a programming language to be incorporated into the system based on the state transition matrix, converting the source program to an object program written in a machine language, executing the object program and calculating time information corresponding to each cell in the state transition matrix based on execution time obtained by the execution of the object program.
Also, a preferable mode is one that wherein comprises the steps of employing the time information storing section composed of at least two out of a first time information storing section to store time information inputted by manipulating the control section corresponding to each cell in the state transition matrix, a second time information storing section to store time information calculated by the first calculating section corresponding to each cell in the state transition matrix, or a third time information storing section to store time information calculated by the second calculating section corresponding to each cell in the state transition matrix, and comparing accumulated results obtained by accumulating the corresponding time information at the time of simulation based on time information stored in at least two out of the time information storing sections 1 to 3.
Also, a preferable mode is one that wherein comprises the steps of employing the time information storing section or the first time information storing section which stores time information as values with a certain latitude or variables in accordance with a permissible range in specifications of the system, reading the maximum value, minimum value, average values or values randomly selected out of the values with a certain latitude when time information corresponding to a specified cell is read from the time information storing section or the first time information storing section or changing the time information to be accumulated in accordance with the variables.
Also, a preferable mode is one that wherein comprises the step of using the test script file being in a timing chart format, in a text file format or in a message sequence chart format.
Also, a preferable mode is one that wherein comprises a step of using the time information which is processing time required for the execution of processing described in a corresponding cell.
Also, a preferable mode is one that wherein comprises the step of using the time information which is overhead time required for transition from a state or a processing to another state or another processing.
Also, a preferable mode is one that wherein comprises the step of using the overhead time which is uniform or varies depending on each cell or each transition.
According to a third aspect of the present invention, there is provided a storage medium storing programs for development of programs to have a computer achieve functions described in the first aspect and the second aspect.